package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** GameLevelRegion数据管理 */
public class GameLevelRegionDBModel extends AbstractDBModel<GameLevelRegionDBModel, GameLevelRegionEntity>
{
    private static GameLevelRegionDBModel instance;

    public static GameLevelRegionDBModel getInstance() {
        if (instance == null) {
            instance = new GameLevelRegionDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "GameLevelRegion.data";
    }

    /** 创建实体 */
    @Override
    protected GameLevelRegionEntity MakeEntity(GameDataTableParser parse)
    {
        GameLevelRegionEntity entity = new GameLevelRegionEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.GameLevelId = parse.GetFieldValueToInt("GameLevelId");
        entity.RegionId = parse.GetFieldValueToInt("RegionId");
        entity.InitSprite = parse.GetFieldValueToUTF8String("InitSprite");
        return entity;
    }
}
